inherited frmMeterNewPH: TfrmMeterNewPH
  Left = 413
  Top = 417
  VertScrollBar.Range = 0
  BorderStyle = bsDialog
  Caption = #1047#1072#1085#1077#1089#1077#1085#1080#1077' '#1087#1086#1082#1072#1079#1072#1085#1080#1081' '#1087#1088#1080#1073#1086#1088#1072' '#1091#1095#1077#1090#1072
  ClientHeight = 264
  ClientWidth = 384
  OldCreateOrder = True
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  inherited Panel1: TPanel
    Top = 237
    Width = 384
    TabOrder = 1
    inherited BitBtn1: TBitBtn
      Left = 177
    end
    inherited BitBtn2: TBitBtn
      Left = 279
      ModalResult = 2
    end
  end
  inherited ToolBar1: TToolBar
    Width = 384
    Height = 0
    TabOrder = 2
  end
  object pan21: TGroupBox [2]
    Left = 0
    Top = 126
    Width = 384
    Height = 111
    Align = alClient
    Caption = ' '#1053#1086#1074#1099#1077' '#1087#1086#1082#1072#1079#1072#1085#1080#1103' '
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -11
    Font.Name = 'MS Sans Serif'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 0
    object Label9: TLabel
      Left = 92
      Top = 19
      Width = 56
      Height = 13
      Alignment = taRightJustify
      Caption = #1055#1086#1082#1072#1079#1072#1085#1080#1103
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ParentFont = False
    end
    object Label17: TLabel
      Left = 56
      Top = 41
      Width = 92
      Height = 13
      Alignment = taRightJustify
      Caption = #1055#1077#1088#1077#1093#1086#1076#1099' '#1095#1077#1088#1077#1079' 0'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ParentFont = False
    end
    object Label3: TLabel
      Left = 27
      Top = 63
      Width = 121
      Height = 13
      Alignment = taRightJustify
      Caption = #1044#1072#1090#1072' '#1089#1085#1103#1090#1080#1103' '#1087#1086#1082#1072#1079#1072#1085#1080#1081
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ParentFont = False
    end
    object dbMeterPH: TDBNumberEditEh
      Left = 154
      Top = 16
      Width = 100
      Height = 19
      AlwaysShowBorder = True
      DecimalPlaces = 0
      EditButtons = <
        item
          Style = ebsMinusEh
          Width = 16
          OnClick = dbMeterPHEditButtons0Click
        end
        item
          Style = ebsPlusEh
          Width = 16
          OnClick = dbMeterPHEditButtons1Click
        end>
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      Flat = True
      ParentFont = False
      TabOrder = 0
      Visible = True
    end
    object dbZero: TDBNumberEditEh
      Left = 154
      Top = 38
      Width = 100
      Height = 19
      AlwaysShowBorder = True
      DecimalPlaces = 0
      EditButtons = <
        item
          Style = ebsMinusEh
          Width = 16
          OnClick = dbZeroEditButtons0Click
        end
        item
          Style = ebsPlusEh
          Width = 16
          OnClick = dbZeroEditButtons1Click
        end>
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      Flat = True
      MaxValue = 1.000000000000000000
      MinValue = -1.000000000000000000
      ParentFont = False
      TabOrder = 1
      Visible = True
    end
    object dbeDate: TDBDateTimeEditEh
      Left = 154
      Top = 60
      Width = 100
      Height = 19
      AlwaysShowBorder = True
      EditButtons = <>
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      Flat = True
      Kind = dtkDateEh
      ParentFont = False
      TabOrder = 2
      Visible = True
    end
    object cbCalc: TDBCheckBoxEh
      Left = 154
      Top = 80
      Width = 167
      Height = 17
      AlwaysShowBorder = True
      Caption = #1056#1072#1089#1095#1080#1090#1072#1090#1100' '#1087#1088#1080' '#1089#1086#1093#1088#1072#1085#1077#1085#1080#1080
      Flat = True
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ParentFont = False
      TabOrder = 3
      ValueChecked = 'True'
      ValueUnchecked = 'False'
    end
  end
  object GroupBox1: TGroupBox [3]
    Left = 0
    Top = 0
    Width = 384
    Height = 126
    Align = alTop
    Caption = ' '#1057#1095#1077#1090#1095#1080#1082' '
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -11
    Font.Name = 'MS Sans Serif'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 3
    object Label1: TLabel
      Left = 68
      Top = 103
      Width = 102
      Height = 13
      Caption = #1058#1077#1082#1091#1097#1080#1077' '#1087#1086#1082#1072#1079#1072#1085#1080#1103
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ParentFont = False
    end
    object Label21: TLabel
      Left = 50
      Top = 15
      Width = 120
      Height = 13
      Alignment = taRightJustify
      AutoSize = False
      Caption = #1048#1044
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ParentFont = False
    end
    object Label24: TLabel
      Left = 50
      Top = 59
      Width = 120
      Height = 13
      Alignment = taRightJustify
      AutoSize = False
      Caption = #1047#1072#1074#1086#1076#1089#1082#1086#1081' '#8470
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ParentFont = False
    end
    object Label43: TLabel
      Left = 50
      Top = 79
      Width = 120
      Height = 13
      Alignment = taRightJustify
      AutoSize = False
      Caption = #1053#1072#1079#1074#1072#1085#1080#1077' '#1089#1095#1077#1090#1095#1080#1082#1072
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ParentFont = False
    end
    object Label2: TLabel
      Left = 50
      Top = 37
      Width = 120
      Height = 13
      Alignment = taRightJustify
      AutoSize = False
      Caption = #1059#1089#1083#1091#1075#1072
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ParentFont = False
    end
    object dbeMeterID: TDBEditEh
      Left = 182
      Top = 12
      Width = 145
      Height = 19
      TabStop = False
      Alignment = taRightJustify
      AlwaysShowBorder = True
      AutoSize = False
      Color = clInactiveCaptionText
      DataField = 'ID'
      DataSource = dsc_Meters
      EditButtons = <>
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      Flat = True
      ParentFont = False
      ParentShowHint = False
      ReadOnly = True
      ShowHint = True
      TabOrder = 0
      Visible = True
    end
    object dbeMeterNum: TDBEditEh
      Left = 182
      Top = 56
      Width = 145
      Height = 19
      TabStop = False
      Alignment = taRightJustify
      AlwaysShowBorder = True
      AutoSize = False
      Color = clInactiveCaptionText
      DataField = 'METER_NUM'
      DataSource = dsc_Meters
      EditButtons = <>
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      Flat = True
      ParentFont = False
      ParentShowHint = False
      ShowHint = True
      TabOrder = 2
      Visible = True
    end
    object dbeMeterName: TDBEditEh
      Left = 182
      Top = 78
      Width = 145
      Height = 19
      TabStop = False
      Alignment = taRightJustify
      AlwaysShowBorder = True
      AutoSize = False
      Color = clInactiveCaptionText
      DataField = 'NAME'
      DataSource = dsc_Meters
      EditButtons = <>
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      Flat = True
      ParentFont = False
      ParentShowHint = False
      ShowHint = True
      TabOrder = 3
      Visible = True
    end
    object DBEditEh4: TDBEditEh
      Left = 182
      Top = 34
      Width = 145
      Height = 19
      TabStop = False
      Alignment = taRightJustify
      AlwaysShowBorder = True
      AutoSize = False
      Color = clInactiveCaptionText
      DataField = 'SERVICE'
      DataSource = dsc_Meters
      EditButtons = <>
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      Flat = True
      ParentFont = False
      ParentShowHint = False
      ReadOnly = True
      ShowHint = True
      TabOrder = 1
      Visible = True
    end
    object dbeMeterInd: TDBEditEh
      Left = 182
      Top = 100
      Width = 145
      Height = 19
      TabStop = False
      Alignment = taRightJustify
      AlwaysShowBorder = True
      AutoSize = False
      Color = clInactiveCaptionText
      DataField = 'PH'
      DataSource = dsc_Meters
      EditButtons = <>
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = [fsBold]
      Flat = True
      ParentFont = False
      ParentShowHint = False
      ReadOnly = True
      ShowHint = True
      TabOrder = 4
      Visible = True
    end
  end
  inherited ActionList1: TActionList
    Left = 340
    Top = 66
    inherited aSave: TAction
      OnExecute = aSaveExecute
    end
    inherited aCancel: TAction
      OnExecute = aCancelExecute
    end
  end
  inherited PropStorage: TPropStorageEh
    Section = 'frm_MeterNewPH'
    StoredProps.Strings = (
      '<P>.Left'
      '<P>.Top'
      '<P>.WindowState'
      'pan21.cbCalc.<P>.Checked')
  end
  object ds_Act: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    RACT_ID'
      'FROM'
      '    PROC_METER_NEW_ACT(:PACCPOINT_ID,'
      '    :PEDATE,'
      '    :PDOCDATE,'
      '    :PMETER_STR,'
      '    :PMETER_PH_STR,'
      '    :PMETER_ZERO_STR) ')
    Transaction = tr_Act
    Database = MAINDM.pMainDatabase
    Left = 239
    Top = 80
    oFetchAll = True
    object ds_ActRACT_ID: TFIBIntegerField
      FieldName = 'RACT_ID'
    end
  end
  object tr_Act: TpFIBTransaction
    DefaultDatabase = MAINDM.pMainDatabase
    TimeoutAction = TARollback
    Left = 269
    Top = 80
  end
  object ds_Meters: TpFIBDataSet
    UpdateSQL.Strings = (
      'UPDATE METERS'
      'SET '
      '    METER_NUM = :METER_NUM,'
      '    METER_TYPE = :METER_TYPE,'
      '    NAME = :NAME,'
      '    LS = :LS,'
      '    VERIFY_DATE = :VERIFY_DATE'
      'WHERE'
      '    ID = :OLD_ID'
      '    ')
    SelectSQL.Strings = (
      'select distinct'
      'm.id, '
      'm.name, '
      'm.meter_num, '
      'm.accpoint_id, '
      
        '  (select first(1) s2.name from proc_accpoint_get_childs (m.accp' +
        'oint_id, m.bdate, m.edate, 1) mda'
      '    join dogovors d on d.accpoint_id = mda.raccpoint_id'
      '    join services s on s.id = d.service_id'
      '    join services s2 on s2.id = s.group_id) as service,'
      ''
      '(SELECT'
      '    RPH'
      'FROM'
      '    PROC_METER_GET_IND(m.id,'
      '    current_date,'
      '    0)) as ph,'
      'mt.precis'
      'from meters m'
      '  join meter_types mt on mt.id = m.meter_type'
      'where m.id = :pmeter_id')
    Transaction = tr_Act
    Database = MAINDM.pMainDatabase
    Left = 238
    Top = 50
    poSQLINT64ToBCD = True
    oFetchAll = True
    object ds_MetersID: TFIBIntegerField
      FieldName = 'ID'
    end
    object ds_MetersNAME: TFIBStringField
      FieldName = 'NAME'
      Size = 60
      EmptyStrToNull = True
    end
    object ds_MetersMETER_NUM: TFIBStringField
      FieldName = 'METER_NUM'
      EmptyStrToNull = True
    end
    object ds_MetersACCPOINT_ID: TFIBIntegerField
      FieldName = 'ACCPOINT_ID'
    end
    object ds_MetersSERVICE: TFIBStringField
      FieldName = 'SERVICE'
      Size = 120
      EmptyStrToNull = True
    end
    object ds_MetersPH: TFIBBCDField
      FieldName = 'PH'
      Size = 3
      RoundByScale = True
    end
    object ds_MetersPRECIS: TFIBIntegerField
      FieldName = 'PRECIS'
    end
  end
  object dsc_Meters: TDataSource
    DataSet = ds_Meters
    Left = 268
    Top = 49
  end
  object trCalc: TpFIBTransaction
    DefaultDatabase = MAINDM.pMainDatabase
    TimeoutAction = TARollback
    Left = 268
    Top = 122
  end
  object QCalc: TpFIBQuery
    Transaction = trCalc
    Database = MAINDM.pMainDatabase
    SQL.Strings = (
      'SELECT'
      '    count(1)'
      'FROM'
      '    PROC_GEN_CHARGE_METER(:PACT_ID,'
      '    current_date,'
      '    1) ')
    Left = 300
    Top = 122
    qoStartTransaction = True
  end
end
